import { axios } from '@/utils/request'

export function selectPage(parameter) {
  return axios({
    url: '/pc/product/selectPage/' + parameter.pageNum + '/' + parameter.pageSize,
    method: 'post',
    data: parameter
  })
}

export function save(parameter) {
  return axios({
    url: '/pc/product/save',
    method: 'post',
    data: parameter
  })
}

export function chargeSave(parameter) {
  return axios({
    url: '/pc/product/chargeSave',
    method: 'post',
    data: parameter
  })
}

export function del(parameter) {
  return axios({
    url: '/pc/product/delete/' + parameter,
    method: 'get'
  })
}


//商品上架下架
export function updateState(parameter) {
  return axios({
    url: '/pc/product/updateState',
    method: 'post',
    params: parameter
  })
}


//商品上架下架精品
export function updateQuality(parameter) {
  return axios({
    url: '/pc/product/updateQuality',
    method: 'post',
    params: parameter
  })
}


export function deletePic(parameter) {
  return axios({
    url: '/pc/common/deletePic/' + parameter,
    method: 'get'
  })
}


export function selectByMasterId(parameter) {
  return axios({
    url: '/pc/product/selectByMasterId/' + parameter,
    method: 'get'
  })
}

export function deleteBatch(parameter) {
  return axios({
    url: '/pc/product/deleteBatch',
    method: 'post',
    data:{
      'products':parameter
    }
  })
}